package com.example.demo.controller;


import com.example.demo.service.UserService;
import com.example.demo.utils.PhoneNumberMasker;
import com.example.demo.utils.UUIDGenerator;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/test")
public class TestController {

    @Autowired
    private UserService userService;

    @GetMapping("/ok")
    public String test()
    {
        return userService.getUserName();
    }

    @GetMapping("/view")
    public String view()
    {
        return UUIDGenerator.generate32BitUUID();
    }

    @GetMapping("/uuid")
    @Cacheable(value = "uuid", key = "#id")
    public String getUUID(Integer id){
        return UUIDGenerator.generate32BitUUID();
    }
}
